<?php
$this->breadcrumbs = array(
    'Manage blocks'
);
?>
<div class="box dark">
    <header>
        <h5>Create new block</h5>
    </header>
    <div class="body">
            <form method="get" action="<?php echo url('/block/create') ?>">
                <select name="type">
                    <?php foreach ($availableBlocks as $id => $name) : ?>
                        <option value="<?php echo $id ?>"><?php echo $name ?></option>
                    <?php endforeach; ?>
                </select>
                <input type="submit" value="Create" class="btn btn-primary" />
            </form>
        </div>
</div>
<div class="box">
    <header>
        <h5>Manage block</h5>
    </header>
    <div class="body">
        <?php
        $this->widget('bootstrap.widgets.TbGridView', array(
            'id' => 'post-grid',
            //'type' => 'striped bordered condensed',
            'dataProvider' => $model->search(),
            'filter' => $model,
            'columns' => array(
                array(
                    'name' => 'block_id',
                    'htmlOptions' => array('width' => '50'),
                    'header' => '#'
                ),
                'name',
                'type',
                array(
                    'name' => 'created',
                    'type' => 'datetime',
                    'filter' => false
                ),
                array(
                    'class' => 'bootstrap.widgets.TbButtonColumn',
                    'template' => '{update}{delete}',
                    'header' => 'Action',
                ),
            ),
        ));
        ?>
    </div>
</div>